/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package multi.agent.simulation.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Owner
 */
@Entity
@Table(name = "estadistica")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Estadistica.findAll", query = "SELECT e FROM Estadistica e"),
    @NamedQuery(name = "Estadistica.findById", query = "SELECT e FROM Estadistica e WHERE e.id = :id"),
    @NamedQuery(name = "Estadistica.findByOrigen", query = "SELECT e FROM Estadistica e WHERE e.origen = :origen"),
    @NamedQuery(name = "Estadistica.findByDestino", query = "SELECT e FROM Estadistica e WHERE e.destino = :destino"),
    @NamedQuery(name = "Estadistica.findByTime", query = "SELECT e FROM Estadistica e WHERE e.time = :time"),
    @NamedQuery(name = "Estadistica.findByTipo", query = "SELECT e FROM Estadistica e WHERE e.tipo = :tipo")})
public class Estadistica implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "origen")
    private int origen;
    @Basic(optional = false)
    @Column(name = "destino")
    private int destino;
    @Basic(optional = false)
    @Column(name = "time")
    @Temporal(TemporalType.TIMESTAMP)
    private Date time;
    @Basic(optional = false)
    @Column(name = "tipo")
    private String tipo;

    public Estadistica() {
    }

    public Estadistica(Integer id) {
        this.id = id;
    }

    public Estadistica(Integer id, int origen, int destino, Date time, String tipo) {
        this.id = id;
        this.origen = origen;
        this.destino = destino;
        this.time = time;
        this.tipo = tipo;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getOrigen() {
        return origen;
    }

    public void setOrigen(int origen) {
        this.origen = origen;
    }

    public int getDestino() {
        return destino;
    }

    public void setDestino(int destino) {
        this.destino = destino;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public String getTipo() {
        return tipo;
    }

    public void setTipo(String tipo) {
        this.tipo = tipo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Estadistica)) {
            return false;
        }
        Estadistica other = (Estadistica) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "multi.agent.simulation.entity.Estadistica[ id=" + id + " ]";
    }
    
}
